import request from '@/utils/request'

// 区域
export function allProvince() {
  return request({
    url: '/app_api/base-region/all-province',
    method: 'get'
  })
}
// banner图
export function indexBanner() {
  return request({
    url: '/app_api/navigation/index-banner',
    method: 'get'
  })
}
// 文章
export function articleList() {
  return request({
    url: '/app_api/system/notice/new-notice',
    method: 'get'
  })
}
// 文章详情
export function articleDetail(query) {
  return request({
    url: `/app_api/system/notice/detail/${query.id}`
  })
}
// 公告
export function notice() {
  return request({
    url: '/app_api/system/notice/new-notice',
    method: 'get'
  })
}
// 公告详情
export function noticeDetail(query) {
  return request({
    url: `/app_api/system/notice/detail/${query.id}`
  })
}
// 首页标签
export function indexLabel() {
  return request({
    url: '/app_api/navigation/index-label',
    method: 'get'
  })
}
// 推荐商品
export function productList() {
  return request({
    url: '/app_api/base/product/list',
    method: 'get'
  })
}
// 秒杀商品
export function productSeckillList(data) {
  return request({
    url: '/app_api/base/product/seckill/list',
    method: 'post',
		data: data
  })
}
// 营销专题
export function spreadSubjectList(data) {
  return request({
    url: '/app_api/spread-subject/list',
    method: 'post',
		data: data
  })
}
// 营销专题详情
export function spreadSubjectDetail(query) {
  return request({
    url: query.regionCode && query.name ? `/app_api/spread-subject/${query.regionCode}/${query.name}/${query.sellChannel}` : `/app_api/spread-subject/${query.id}/${query.sellChannel}`,
    method: 'get'
  })
}
// DIY配置1
export function shopMobilePage(query) {
  return request({
    url: `/app_api/shop/mobile/page/${query.pageCode}`,
    method: 'get'
  })
}
// DIY配置2
export function shopMobilePage2(query) {
  return request({
    url: `/shop/mobile/page/${query.pageCode}/${query.regionCode}`,
    method: 'get'
  })
}
